home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / bsd / rpcsvc / ether.x < prev    next >
Text File  |  1990-01-29  |  2KB  |  120 lines

  1. /*    @(#)ether.x    1.2 88/05/08 4.0NFSSRC SMI    */
  2.  
  3. /* 
  4.  * Copyright (c) 1988 by Sun Microsystems, Inc.
  5.  * @(#) from SUN 1.4
  6.  */
  7.  
  8. /*
  9.  * Gather statistics about the ethernet
  10.  */
  11.  
  12. const NBUCKETS = 16;
  13. const NPROTOS = 6;
  14. const HASHSIZE = 256;
  15.  
  16. /*
  17.  * Seconds and microseconds since 0:00, January 1, 1970
  18.  */
  19. struct ethertimeval {
  20.     unsigned int tv_seconds;
  21.     unsigned int tv_useconds;
  22. };
  23.  
  24. /*
  25.  * all ether stat's except src, dst addresses
  26.  */
  27. struct etherstat {
  28.     ethertimeval    e_time;
  29.     unsigned int e_bytes;
  30.     unsigned int e_packets;
  31.     unsigned int e_bcast;
  32.     unsigned int e_size[NBUCKETS];
  33.     unsigned int e_proto[NPROTOS];
  34. };
  35. /*
  36.  * member of address hash table
  37.  */
  38. struct etherhmem_node {
  39.     int h_addr;
  40.     unsigned int h_cnt;
  41.     etherhmem_node *h_nxt;
  42. };
  43. typedef etherhmem_node *etherhmem;
  44.  
  45. /*
  46.  * src, dst address info
  47.  */
  48. struct etheraddrs {
  49.     ethertimeval    e_time;
  50.     unsigned int e_bytes;
  51.     unsigned int e_packets;
  52.     unsigned int e_bcast;
  53.     etherhmem e_addrs[HASHSIZE];
  54. };
  55.  
  56. struct addrmask {
  57.     int a_addr;
  58.     int a_mask;
  59. };
  60.  
  61.  
  62. program ETHERPROG {
  63.     version ETHERVERS {
  64.         /*
  65.          * Get ethernet data
  66.          */
  67.         etherstat
  68.         ETHERPROC_GETDATA(void) = 1;
  69.  
  70.         /*
  71.          * Turn on promiscuous mode
  72.          */
  73.         void
  74.         ETHERPROC_ON(void) = 2;
  75.  
  76.         /*
  77.          * Turn off promiscous mode
  78.          */
  79.         void
  80.         ETHERPROC_OFF(void) = 3;
  81.  
  82.  
  83.         /*
  84.          * Return source address information
  85.          */
  86.         etheraddrs
  87.         ETHERPROC_GETSRCDATA(void) = 4;
  88.  
  89.         /*
  90.          * Return destination address information
  91.          */
  92.         etheraddrs
  93.         ETHERPROC_GETDSTDATA(void) = 5;
  94.  
  95.         /*
  96.          * Select source address mask
  97.          */
  98.         void
  99.         ETHERPROC_SELECTSRC(addrmask) = 6;
  100.  
  101.         /*
  102.          * Select destination address mask
  103.          */
  104.         void
  105.         ETHERPROC_SELECTDST(addrmask) = 7;
  106.  
  107.         /*
  108.          * Select protocol mask
  109.          */
  110.         void
  111.         ETHERPROC_SELECTPROTO(addrmask) = 8;
  112.  
  113.         /*
  114.          * Select length mask
  115.          */
  116.         void
  117.         ETHERPROC_SELECTLNTH(addrmask) = 9;
  118.     } = 1;
  119. } = 100010;
  120.